﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>	
<<c:set var="path" value="${pageContext.request.contextPath }"></c:set>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#particles-js{
width: 100%;
			height: 100%;
 position: absolute;
}
form{
 position: relative;
}
  
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 

<title>登录</title>
<link href="${pageContext.request.contextPath }/static/css/login.css" type="text/css" rel="stylesheet"> 

</head> 
<body> 
<div id='particles-js'>
</div>
<div class="div_top">企业人事管理系统</div>
<div class="login">
    <div class="message">用户登录</div>
    <div id="darkbannerwrap"></div>
    
    <form method="post" action="${pageContext.request.contextPath }/login.html">
    	<div class="info" style="color: red;font-weight:bold; ">${error }</div>
		<input name="action" value="login" type="hidden">
		<input name="user_code" placeholder="用户名" required="" type="text" id="user">
		<hr class="hr15">
		<input name="user_password" placeholder="密码" required="" type="password" id="pass">
		<hr class="hr15">
		<input value="登录" style="width:100%;" type="submit" id="login_btn">
		<hr class="hr20">
		  <a onClick="alert('请联系管理员')">忘记密码</a>
	</form>

	
</div>

<div class="copyright">版权所有@<span style="color:#f77118">2017 </span>杭州天夏科技股份集团有限公司</div>
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script >
	$(function(){
		$("#login_btn").click(function(){

			var selectuser = $("#user").val();
			var pword = $("#pass").val();

			if (selectuser == "" || selectuser.length <= 1) {
				alert("用户名不能为空");
				$("#user").focus();
				return false;
			}
			if (pword == "" || pword.length < 1) {
				alert("密码不能为空");
				$("#pass").focus();
				return false;
			}
			getUserDep(selectuser,pword);


		});

		function getUserDep(v1,v2){
			$.ajax({
				type: "post",
				url: "LoginServlet",
				data:{adid:v1,mima:v2},
				success: function(message){
					if(message=="1"){
						window.location.href='index.html';
					}
					else{
						alter("密码错误");
					}
				}

			});
		}
	});

</script>
</body>
<script src="${path }/static/js/particles.min.js"></script>
	<script type="text/javascript"
		src="http://www.ca315189.com/res/login/js/app.js"></script>
</html>

